package com.kantboot.system.user.web.admin.controller;

import com.kantboot.system.user.domain.dto.SysPermissionSearchDTO;
import com.kantboot.system.user.domain.entity.SysPermission;
import com.kantboot.system.user.service.ISysPermissionService;
import com.kantboot.util.common.result.RestResult;
import com.kantboot.util.core.controller.BaseAdminController;
import com.kantboot.util.core.param.PageParam;
import com.kantboot.util.core.result.PageResult;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/system-user-web/admin/permission")
public class SysPermissionControllerOfAdmin extends BaseAdminController<SysPermission,Long> {

    @Resource
    private ISysPermissionService service;

    @RequestMapping("/getBodyData")
    public RestResult<PageResult> getBodyData(@RequestBody PageParam<SysPermissionSearchDTO> pageParam) {
        return RestResult.success(service.getBodyData(pageParam),"getSuccess","获取成功");
    }

    @RequestMapping("/getListByCodeList")
    public RestResult<Iterable<SysPermission>> getListByCodeList(@RequestParam("codeList") List<String> codeList) {
        return RestResult.success(service.getListByCodeList(codeList),"getSuccess","获取成功");
    }


}
